<?php
class ui_reader_i_default extends ui {
	/**
	 * @param Object $S
	 * @param Array $param
	 * 
	 * 		$_GET['id']		// content_id
	 * 		$_GET['c']		// md5(uid . content_id . 'uReadMe')
	 *		$_GET['t']		// clip / notclip
	 */
	public function __construct($S, $param) {
		parent::__construct();
		
		$_GET['id'] = intval($_GET['id']);
		
		if ($this->uid and md5($this->uid . $_GET['id'].'uReadMe') === $_GET['c']) {
			
			// ## 临时测试 #################################
			$data_save_article = new data_save_article();
			$data_save_article->auto_clip_by_event($_GET['id']);
			// ## 临时测试 #################################
			
			
			$data_article = new data_article();
			
			if ($_GET['t'] == 'clip') {
				$content = $data_article->get_content_clip($_GET['id']);
				if (empty($content)) {
					$content = $data_article->get_save_article_content($_GET['id']);
				}
			} else {
				$content = $data_article->get_save_article_content($_GET['id']);
			}
			
			$S->assign('content', $content);
			
		} else die();
	}
}
?>